Add config to control MCP path appending to backend endpoint URL#14223
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAcross four distribution module templates, MCP request handling now conditionally removes ChangesMCP path handling and test updates
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #14223 +/- ##
============================================
- Coverage 9.45% 9.44% -0.01%
Complexity 785 785
============================================
Files 365 365
Lines 17839 17847 +8
Branches 1908 1909 +1
============================================
Hits 1686 1686
- Misses 16126 16134 +8
Partials 27 27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
5a5c778 to
d76a859
Compare
d76a859 to
111a76d
Compare
Purpose
When the MCP path append feature flag is enabled,
/mcpwas unconditionally appended to MCP server backend endpoint URLs, causing 404 errors for MCP servers that don't expose a/mcppath segment. This change updates the Velocity templates to conditionally strip the URL postfix for MCP APIs based on themcpPathAppendedmetadata flag.Related issue: wso2/api-manager#5046
Approach
velocity_template.xml(all four distribution profiles:all-in-one-apim,api-control-plane,gateway,traffic-manager) — added a Velocity conditional block that removes theREST_URL_POSTFIXaxis2 property for MCP APIs when$mcpPathAppendedis nottrue. This ensures that when MCP path appending is disabled (the default), the gateway forwards requests to the backend URL as-is without appending/mcp.